package com.atcd.sotoken.run;

import com.atcd.sotoken.utils.ConfigFileWatcher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class AppRunner implements ApplicationRunner {

    private final ConfigFileWatcher ConfigFileWatcher;

    public AppRunner(ConfigFileWatcher ConfigFileWatcher) {
        this.ConfigFileWatcher = ConfigFileWatcher;
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        ConfigFileWatcher.startWatching();
        log.info("监控任务启动...");
    }
}